<template>
	<view class="content">
		<u-field
			v-model="form.userName"
			label="账号"
			placeholder="请填写账号"
		>
		</u-field>
		<u-field
			v-model="form.password"
			label="密码"
			placeholder="请填写密码"
		>
		</u-field>
		<u-button type="primary" @click="toLogin">主要按钮</u-button> <br/>
		<u-button type="primary" @click="toQueryUser">查询按钮</u-button>
	</view>
</template>

<script>
	import { mapActions,mapState } from 'vuex'
	import { lis } from '@/utils/apis/user.js'
	export default {
		data() {
			return {
				form: {
					userName: '',
					password: ''
      	}
			}
		},
		onLoad() {

		},
		computed:{ 
			...mapState({
				loginInfo: state => state.user.loginInfo,
			}),
		},		
		methods: {
			...mapActions({
      	handleLogin: 'user/handleLogin'
    	}),
			toLogin() {
			  console.log(this.form);
				this.handleLogin({...this.form})
			},
			toQueryUser() {
				lis({name:"",phone:"",pageSize:10,pageNo:1}).then(({data})=>{
					console.log(data);
				}).catch(err =>{
				})
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
</style>
